package com.ipet.web.service;

import java.util.List;

import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.ipet.web.pojo.Cart;

@FeignClient("ipet-cart")
public interface CartService {
	
	@RequestMapping(method=RequestMethod.GET,value="/cart/query/{userId}")
	List<Cart> findCartByUserId(@PathVariable("userId") Long userId);
	
	@RequestMapping(value="/cart/update",method=RequestMethod.POST)
	void updateCartNum(@RequestBody Cart cart);
	
	@RequestMapping(value="/cart/delete/{userId}/{itemId}",method=RequestMethod.GET)
	void deleteCart(@PathVariable("userId") Long userId, @PathVariable("itemId") Long itemId);
	
	@RequestMapping(value="/cart/add",method=RequestMethod.POST)
	void addCart(@RequestBody Cart cart);

}
